package cn.wolfcode.luowowo.article.service.impl;

import cn.wolfcode.luowowo.article.domain.HotelDetail;
import cn.wolfcode.luowowo.article.mapper.HotelDetailMapper;
import cn.wolfcode.luowowo.article.service.IHotelDetailService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class HotelDetailServiceImpl implements IHotelDetailService {
   @Autowired
    private HotelDetailMapper hotelDetailMapper;

    public List<HotelDetail> selectHDTop(int num) {
        List<HotelDetail> list = hotelDetailMapper.selectHDTop();
        if(list.size()>=num){
            list = list.subList(0,num);
        }
        return list;
    }

    public List<HotelDetail> selectByDid(Long did) {
        return hotelDetailMapper.selectByDid(did);
    }
}
